home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / listserv / utils / change_emailaddr.pl < prev    next >
Encoding:
Internet Message Format  |  1993-07-30  |  1.8 KB

  1. From peter.lewis@info.curtin.edu.au Thu Jul 29 21:45:08 1993
  2. Return-Path: <peter.lewis@info.curtin.edu.au> test
  3. Received: from cujo.curtin.edu.au by cs-mail.bu.edu (5.61+++/Spike-2.1)
  4.     id AA25548; Thu, 29 Jul 93 21:44:35 -0400
  5. Received: from ncrpda.curtin.edu.au by cujo.curtin.edu.au with SMTP id AA04125
  6.   (5.65c/IDA-1.4.4 for <tasos@cs.bu.edu>); Fri, 30 Jul 1993 09:43:57 +0800
  7. Received: from [134.7.122.51] (rocky) by ncrpda.curtin.edu.au with SMTP id AA22330
  8.   (5.65c/IDA-1.4.4 for <tasos@cs.bu.edu>); Fri, 30 Jul 1993 09:43:58 +0800
  9. Message-Id: <199307300143.AA22330@ncrpda.curtin.edu.au>
  10. Date: Fri, 30 Jul 1993 09:46:36 +0800
  11. To: tasos@cs.bu.edu
  12. From: Peter N Lewis <peter.lewis@info.curtin.edu.au>
  13. X-Sender: peter@ncrpda.curtin.edu.au
  14. Subject: changename.pl
  15. Status: RO
  16.  
  17. Hi,
  18.  
  19. People occasionally change their Email address, and its a pain for either
  20. them or me to make the change (unless list server does some magic somewhere
  21. that I haven't seen).  Anyway, here is a perl script to do it, I don't know
  22. if you want to include it with list server, or hack it up into something
  23. more useful or ignore it.  Anyway, if you want to do anything with it, its
  24. all yours, if not, chuck it in the bin :-)
  25.    Peter.
  26.  
  27. #!/usr/local/bin/perl -w
  28.  
  29. $argc = $#ARGV +1;
  30.  
  31. if ($argc !=2) {
  32.   print "Usage: changename.pl oldname newname\n";
  33.   print "$argc\n";
  34.   exit(1);
  35. }
  36.  
  37. $old=shift @ARGV;
  38. die unless $old;
  39. $new=shift @ARGV;
  40. die unless $new;
  41.  
  42. $old =~ tr/a-z/A-Z/;
  43. $new =~ tr/a-z/A-Z/;
  44.  
  45. for $dir (<*>) {
  46.   next unless -e "$dir/.subscribers";
  47.   print "$dir\n";
  48.   system("perl -i.bak -pe 's/^$old /$new /' $dir/.subscribers");
  49.   system("diff $dir/.subscribers.bak $dir/.subscribers");
  50. }
  51. _______________________________________________________________________
  52. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  53.  
  54.  
  55.